<?php

/**
 * @export Router
 */
class JAWRouting extends Routing {

    public function appAction($app, $module, $task = "index", $params = array()) {
        /* @var $mainframe JApplication */
        global $mainframe;
        $itemId = JRequest::getVar("Itemid", 2);
        
        $currentComponent = $mainframe->scope;
        $route = JRoute::_("index.php?option=$currentComponent&Itemid=$itemId&controller=$app.$module&task=$task");
        foreach ($params as $key => $value) {
            $route .= "&$key=$value";
        }
        return $route;
    }

    public function redirect($url) {
        /* @var $url JApplication */
        global $mainframe;
        $mainframe->redirect($url);
    }

}

?>
